<?php



if (isset($_GET['pkcreneau']) && isset($_GET['nom_spectacle'])) {
	$pkcreneau = $_GET['pkcreneau'];
	$nomspectacle = sql_protect(html_escape($_GET['nom_spectacle']));
}

	$result = SGBD::query(
			"UPDATE creneau
			SET nomspectacle ='$nomspectacle'
			WHERE (pkcreneau='$pkcreneau');");
	if(!$result) {

	}

	$result = SGBD::query(
			"SELECT c.nomsalle, c.cpcommune
			FROM creneau c 
			WHERE (pkcreneau='$pkcreneau');");
	if(!$result) {

	}

	
	
while($data = SGBD::fetch($result)){
		$nomsalle = sql_protect(html_escape($data['nomsalle']));
		$code = $data['cpcommune'];
	}
	
	$template->setTemplateFile('admin_representations_recommencer','tpl/admin_representations_recommencer.tpl');
	$template->parseTemplate('admin_representations_recommencer',"NOM_SALLE",$nomsalle);
	$template->parseTemplate('admin_representations_recommencer',"CODE_POSTAL",$code);
	

	$template->parseTemplate('admin_representations_recommencer',"RETOUR","Non");
	$template->parseTemplate('admin_representations_recommencer',"AJOUT","Oui");
	$template->parseTemplate('admin_representations_recommencer',"NOM_SPECTACLE",$nomspectacle);
	$template->setTemplateFile('center','tpl/center.tpl');
	$template->parseTemplate('center',"CENTER_CONTENT",$template->getTemplate('admin_representations_recommencer'));
?>

